<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php echo $this->Html->charset(); ?>
        <title>
            <?php __('CERRAJERÍA ITUZAINGÓ'); ?>
            <?php echo $title_for_layout; ?>
        </title>
        <?php
        echo $this->Html->meta('icon');

        echo $this->Html->css('style');
        echo $this->Html->css('crop');
        echo $this->Html->css('cake.generic');
        echo $this->Html->css('login');
        echo $this->Html->css('filtro');
        echo $this->Html->css('ui-lightness/jquery-ui-1.8.16.custom');
        echo $javascript->link('jquery-1.6.2.min');
        echo $javascript->link('jquery-ui-1.8.16.custom.min');
        echo $javascript->link('jquery.ui.datepicker-es');

        echo $scripts_for_layout;
        ?>
    </head>
    <body>
        <div id="container">
            <div id="header">
                <?php
                echo $this->Html->link(
                        $this->Html->image('banner.jpg', array('alt' => 'Cerrajeria Ituzaingo')), 'http://www.llavesituzaingo.com.ar', array('escape' => false, 'target'=>'_blank')
                );
                ?>
            </div>
            <div id="container_user" class="login">
                <span class="inicio"><b>Sistema de Administración</b></span>
                <span class="fin">
                    <?php
                    if ($this->Session->read('Auth.User.id')) {
                        echo '¡' . __('Hola', true) . ' ' . $this->Session->read('Auth.User.first_name') . '!';
                        echo '&nbsp;&nbsp;&nbsp;';
                        echo $this->Html->link(__('Inicio', true), array('controller' => 'articles', 'action' => 'inicio'));
                        echo '&nbsp;&nbsp;&nbsp;';
                        echo $this->Html->link(__('Cerrar Sesión', true), array('controller' => 'users', 'action' => 'logout'));
                        echo '&nbsp;&nbsp;&nbsp;';
                        echo $this->Html->link('Manual', '/files/Manual Usuario - Cerrajeria.pdf');
                        //Path completo C:\xampp\htdocs\cerrajeria\app\webroot\files
                    } else {
                        ?>
                        <?php
//                        echo $this->Html->link(__('Inicio', true), array('controller' => 'articles', 'action' => 'inicio'));
//                        echo '&nbsp;&nbsp;&nbsp;';
//                        echo $this->Html->link(__('Cerrar Sesión', true), array('controller' => 'users', 'action' => 'logout')); ?>
                    <?php } ?>
                </span>
            </div>
            <div id="content">

                <?php
                echo $this->Session->flash();
                echo $this->Session->flash('auth');
                ?>
                <div class="actions">
                    <h3><?php __('Menú:'); ?></h3>
                    <ul>
                        <!--                    //MENU 1RA PARTE: CONTROL STOCK CERRAJERIA-->
                            <li><?php echo $this->Html->link(__('Tipos', true), array('controller' => 'types', 'action' => 'index')); ?> </li>
                        <?php if ($this->Session->read('Auth.User.level') == 1 || $this->Session->read('Auth.User.level') == 2) { ?>
                            <li><?php echo $this->Html->link(__('Proveedores', true), array('controller' => 'suppliers', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Artículos', true), array('controller' => 'articles', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Compras', true), array('controller' => 'purchases', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Ventas', true), array('controller' => 'sales', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Estadisticas', true), array('controller' => 'pruebas', 'action' => 'index')); ?> </li>
                        <?php } ?>
                        <!--                    //MENU 2DA PARTE: LLAVES CODIFICADAS -->                        
                        <?php if ($this->Session->read('Auth.User.level') == 1 || $this->Session->read('Auth.User.level') == 3) { ?>
                            <li><?php echo $this->Html->link(__('Clientes', true), array('controller' => 'clients', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Autos', true), array('controller' => 'cars', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Llaves', true), array('controller' => 'keys', 'action' => 'index')); ?> </li>
    <!--                        <li><?php echo $this->Html->link(__('Copias', true), array('controller' => 'copies', 'action' => 'index')); ?> </li>-->
                            <li><?php echo $this->Html->link(__('Historial', true), array('controller' => 'records', 'action' => 'index')); ?> </li>
                        <?php } ?>
                        <!--                    SOLO PARA ADMINISTRADOR: AMB DE USUARIOS-->
                        <?php if ($this->Session->read('Auth.User.level') == 1) { ?>
                            <li><?php echo $this->Html->link(__('Usuarios', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
                            <li><?php echo $this->Html->link(__('Backup', true), array('controller' => 'users', 'action' => 'backup')); ?> </li>
                        <?php } ?>
                    </ul>
                </div>
                <?php echo $content_for_layout; ?>
            </div>
            <div id="footer">
                <?php
                echo 'Programador: Gabriel Dalmolin';
//                $this->Html->link(
//                        $this->Html->image('cake.power.gif', array('alt' => __('CakePHP: the rapid development php framework', true), 'border' => '0')), 'http://www.cakephp.org/', array('target' => '_blank', 'escape' => false)
//                );
                ?>
            </div>
        </div>
        <?php echo $this->element('sql_dump'); ?>
    </body>
</html>